<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body onload="test()">
<a id="anch" href="#"></a>
<a id="anch2" href="#"></a>
<input>

<script>
description('This tests that focus() and sequential focus navigation work on empty anchors.');
jsTestIsAsync = true;
var emptyAnchor1 = document.getElementById("anch");
var emptyAnchor2 = document.getElementById("anch2");
function test() {
    emptyAnchor1.focus();
    shouldBe('document.activeElement', 'emptyAnchor1');

    testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true);
    eventSender.keyDown('\t');
    shouldBe('document.activeElement', 'emptyAnchor2');
    finishJSTest();
}
</script>
</body>
</html>
